import { Lexer } from "./compiler/Lexer";
import { RunTime } from "./runtime/Runtime";
import { JsonUtils } from "./utils/JsonUtils";
import { StringUtils } from "./utils/StringUtils";



let str = '\
class Start { \
    intA = 10; \
    constructor() { \
        console.log("Start constructor"); \
        this.testFunc(-1, "debug"); \
    } \
 \
    main() { \
        console.log("hello world"); \
        for(let i = 0; i < 10; i++) { \
            console.log(i); \
        }        \
    } \
 \
    testFunc(param1 : number, param2 : string) { \
        if (param1 > 0) { \
            console.log(param1, param2); \
        } \
        else if(param2  == "debug") { \
            console.log("debug " + this.intA); \
        } \
        else { \
            console.log("else"); \
        } \
    } \
} \
';


let jsonStr = JsonUtils.toJson(str);
let tokens = JsonUtils.getData(JSON.parse(jsonStr));

RunTime.run({
    tokens: tokens,
    mainClassName: "Start",
    global: {
        console: console
    }
});

console.log(StringUtils.deconfuseString("vqmgpu"));
console.log(StringUtils.deconfuseString("inqdcn"));
module.exports = { RunTime: RunTime, JsonUtils: JsonUtils, StringUtils: StringUtils, Lexer: Lexer };